/**
 * 驱动实体
 */
(function(window, angular, undefined){

	var module = angular.module('water.entity.LogMonitor',['water.common.AJAXService']);
	
	module.service('$LogMonitorService',function($AJAXService){
		
		/**
		 * 获取监控列表
		 */
		this.getList = function(){
			var promise = $AJAXService.post("/LogMonitor/getList");
			return promise;
		}
		
		/**
		 * 获取单条日志消息
		 */
		this.getLogMsg = function(monitorId){
			var promise = $AJAXService.post("/LogMonitor/getLogMsg",{monitorId:monitorId});
			return promise;
		}
		
		/**
		 * 获取错误单条日志消息
		 */
		this.getErrorLogMsg = function(monitorId){
			var promise = $AJAXService.post("/LogMonitor/getErrorLogMsg",{monitorId:monitorId});
			return promise;
		}
		
		/**
		 * 获取日志文件内容
		 */
		this.getLogFile = function(monitorId){
			var promise = $AJAXService.myPost("/scy/log/"+monitorId+".log",null,null,"text");
			return promise;
		}
		
		/**
		 * 获取日志消息列表
		 */
		this.getLogMsgList = function(monitorId){
			var promise = $AJAXService.post("/LogMonitor/getLogMsgList",{monitorId:monitorId});
			return promise;
		}
		
		/**
		 * 获取错误日志消息列表
		 */
		this.getErrorLogMsgList = function(monitorId){
			var promise = $AJAXService.post("/LogMonitor/getErrorLogMsgList",{monitorId:monitorId});
			return promise;
		}
		
		/**
		 * 清空消息
		 */
		this.clearMsg = function(monitorId){
			var promise = $AJAXService.post("/LogMonitor/clearMsg",{monitorId:monitorId});
			return promise;
		}
		
	})
}(window, angular));